home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- global Saddit, sDoublure, sLETTRES, equiva, lences, sTrans1, niveau, sTuile1, sEcran
- set sEcran to 50
- set Saddit to 15
- set sDoublure to 16
- set sTuile1 to 3
- set sLETTRES to 9
- set sTrans1 to 26
- set equiva to [121, 128, 129, 133, 135, 140, 141, 142, 143, 144, 145, 68, 69, 74, 75, 84, 86, 183, 184, 185, 188, 189, 191, 195, 204]
- set lences to [1, 8, 9, 13, 15, 20, 21, 22, 23, 24, 25, 8, 9, 14, 15, 24, 26, 3, 4, 5, 8, 9, 11, 15, 24]
- if voidp(niveau) then
- set niveau to 1
- end if
- set destin to "niv" & niveau
- go(destin)
- end
-
- on initCurseur
- global sTuile1
- repeat with s = sTuile1 to sTuile1 + 5
- set the cursor of sprite s to [member 19, member 20]
- end repeat
- end
-
- on resetPuzzle
- global niveau
- PuppetsOFF()
- set destin to "niv" & niveau
- go(destin)
- end
-
- on bougeLe qui
- global Saddit, sDoublure, sPlaque
- switche(qui, Saddit)
- set sPlaque to qui - 6
- repeat while the stillDown
- set crit to 12
- set oldX to the locH of sprite Saddit
- set oldY to the locV of sprite Saddit
- set the loc of sprite sDoublure to the loc of sprite Saddit
- set demandeX to the mouseH - oldX
- set demandeY to the mouseV - oldY
- if abs(demandeX) > abs(demandeY) then
- if demandeX > crit then
- set the locH of sprite sDoublure to oldX + crit
- else
- if demandeX < -crit then
- set the locH of sprite sDoublure to oldX - crit
- end if
- end if
- updateStage()
- if sprite sDoublure within 1 and lesAutres(qui - 6) then
- if the locH of sprite sDoublure <> the locH of sprite Saddit then
- set the locH of sprite Saddit to the locH of sprite sDoublure
- set the locH of sprite sPlaque to the locH of sprite sDoublure
- puppetSound("glisseContinu")
- updateStage()
- end if
- end if
- next repeat
- end if
- if demandeY > crit then
- set the locV of sprite sDoublure to oldY + crit
- else
- if demandeY < -crit then
- set the locV of sprite sDoublure to oldY - crit
- end if
- end if
- updateStage()
- if sprite sDoublure within 1 and lesAutres(qui - 6) then
- if the locV of sprite sDoublure <> the locV of sprite Saddit then
- set the locV of sprite Saddit to the locV of sprite sDoublure
- set the locV of sprite sPlaque to the locV of sprite sDoublure
- puppetSound("glisseContinu")
- updateStage()
- end if
- end if
- end repeat
- switche(Saddit, qui)
- verifie()
- end
-
- on verifie
- global leProb, sLETTRES, equiva, lences
- repeat with s = sLETTRES to sLETTRES + 5
- if the locV of sprite s < 398 then
- exit
- end if
- end repeat
- repeat with s = sLETTRES to sLETTRES + 5
- set c to the memberNum of sprite s
- set pos to getOne(equiva, c)
- if pos <> 0 then
- set the memberNum of sprite s to getAt(lences, pos)
- updateStage()
- end if
- end repeat
- set lesLettres to ordreObtenu()
- repeat with lettre = 1 to 6
- if getAt(lesLettres, lettre) <> getAt(leProb, lettre) then
- exit
- end if
- end repeat
- onLa()
- retourne(1)
- end
-
- on ordreObtenu
- global sLETTRES
- set laListe to []
- repeat with p = 1 to 6
- set posH to (p * 48) + 152
- repeat with s = sLETTRES to sLETTRES + 5
- if the locH of sprite s = posH then
- append(laListe, the memberNum of sprite s)
- end if
- end repeat
- end repeat
- return laListe
- end
-
- on lesAutres qui
- global sDoublure, Saddit, sTrans1, nTrans, sTuile1
- set Ok to 1
- set deb to sTrans1 + nTrans
- set fin to deb + nTrans - 1
- repeat with s = deb to fin
- if sprite sDoublure intersects s and (the locV of sprite s = the locV of sprite sDoublure) then
- set tiensMoiCa to the locH of sprite sDoublure
- set the locH of sprite sDoublure to (the locH of sprite s * 2) - the locH of sprite Saddit
- updateStage()
- if yaPersonneA(sDoublure) then
- transforme(s)
- end if
- set the locH of sprite sDoublure to tiensMoiCa
- set Ok to 0
- exit repeat
- end if
- end repeat
- repeat with s = sTuile1 to sTuile1 + 5
- if sprite sDoublure intersects s and (s <> qui) then
- set Ok to 0
- exit repeat
- end if
- end repeat
- return Ok
- end
-
- on yaPersonneA qui
- global sTuile1
- set Ok to 1
- repeat with s = sTuile1 to sTuile1 + 5
- if sprite qui intersects s and (s <> qui) then
- set Ok to 0
- exit repeat
- end if
- end repeat
- return Ok
- end
-
- on transforme sTrans
- global Saddit, sPlaque, nTrans
- if the locH of sprite Saddit < the locH of sprite sTrans then
- set diff to 2
- set the locH of sprite Saddit to the locH of sprite sTrans - 34
- set the locH of sprite sPlaque to the locH of sprite sTrans - 34
- updateStage()
- else
- set diff to -2
- set the locH of sprite Saddit to the locH of sprite sTrans + 34
- set the locH of sprite sPlaque to the locH of sprite sTrans + 34
- updateStage()
- end if
- puppetSound("magnetik")
- repeat while the locH of sprite Saddit <> the locH of sprite sTrans
- set the locH of sprite Saddit to the locH of sprite Saddit + diff
- set the locH of sprite sPlaque to the locH of sprite sPlaque + diff
- updateStage()
- niaise(1)
- end repeat
- animeLeTransfo(sTrans, diff)
- set the member of sprite Saddit to member transformeLettre(sTrans, diff) of castLib "lettres.cst"
- updateStage()
- puppetSound("magnetik")
- updateStage()
- repeat with i = 1 to 24
- set the locH of sprite Saddit to the locH of sprite Saddit + diff
- set the locH of sprite sPlaque to the locH of sprite sPlaque + diff
- updateStage()
- niaise(1)
- end repeat
- end
-
- on animeLeTransfo sTrans, direction
- set c to the memberNum of sprite sTrans
- puppetSound("inverseur")
- updateStage()
- if direction > 0 then
- repeat with i = 0 to 7
- set the memberNum of sprite sTrans to member (c + i) of castLib 1
- updateStage()
- attends(5)
- end repeat
- else
- repeat with i = 7 down to 0
- set the memberNum of sprite sTrans to member (c + i) of castLib 1
- updateStage()
- attends(5)
- end repeat
- end if
- set the memberNum of sprite sTrans to member c of castLib 1
- repeat while soundBusy(1)
- updateStage()
- end repeat
- end
-
- on transformeLettre sTrans, direction
- global Saddit
- set cTrans to the memberNum of sprite sTrans
- set cn to the memberNum of sprite Saddit
- if cTrans = 31 then
- if cn < 120 then
- return cn + 120
- else
- return cn - 120
- end if
- else
- if cTrans = 41 then
- if cn < 60 then
- return cn + 60
- else
- if cn < 120 then
- return cn - 60
- else
- if cn < 180 then
- return cn + 60
- else
- return cn - 60
- end if
- end if
- end if
- else
- if cTrans = 51 then
- if direction > 0 then
- if (cn mod 30) = 26 then
- return cn - 25
- else
- return cn + 1
- end if
- else
- if (cn mod 30) = 1 then
- return cn + 25
- else
- return cn - 1
- end if
- end if
- end if
- end if
- end if
- end
-